Skip to content

feat(coordinator): wire config-docs via a buildSrc plugin and declarative spec#3607

Open
gauravahuja wants to merge 1 commit into
feat/config-docs-modulefrom
feat/config-docs-coordinator-wiring
Open

feat(coordinator): wire config-docs via a buildSrc plugin and declarative spec#3607
gauravahuja wants to merge 1 commit into
feat/config-docs-modulefrom
feat/config-docs-coordinator-wiring

Conversation

@gauravahuja

@gauravahuja gauravahuja commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Stacked PR — base is feat/config-docs-module (#3606). Review/merge #3606 first.

Summary

Wires the config-docs engine into coordinator:app without shipping tooling in the production jar, via a reusable buildSrc convention plugin (so Maru can adopt with almost no code).

  • buildSrc plugin linea.config-docs — creates a configDocs source set (compiled against main + the config-docs engine, kept out of the jar), adds the engine dependency, and registers checkConfigDocs / generateConfigDocs tasks. The tasks run the engine's generic entry points against the app's ConfigDocsSpec.
  • Declarative spec — the app names its spec in build.gradle (configDocs { spec = "…CoordinatorConfigDocsSpec" }); the plugin passes that FQCN to the generic main, which loads it. No per-app entry-point code, no META-INF/services.
  • CoordinatorConfigDocsSpec (in the configDocs source set) — the one declarative object: config-file roots, section detector, output paths, title.

Adopting in another app (e.g. Maru)

  1. id 'linea.config-docs' + configDocs { spec = "…" } in build.gradle.
  2. A ConfigDocsSpec object listing its roots + section package prefix.

Notes

  • checkConfigDocs currently reports the undocumented keys — the config classes are annotated in the next PR. Not yet wired into check.
  • Generated artifacts (JSON schema + Markdown) are committed in a later PR.
  • Task type is JavaExec (runs app code against the app classpath in a forked JVM); inputs/outputs wiring for incrementality is a follow-up.

Test plan

  • ./gradlew :coordinator:app:checkConfigDocs — runs through plugin → source set → module main → spec; reports the expected undocumented keys.
  • ./gradlew :coordinator:app:generateConfigDocs — writes both artifacts.
  • ./gradlew :coordinator:app:spotlessCheck :coordinator:app:compileConfigDocsKotlin — passes.

Note

Low Risk
Build-time Gradle wiring and a non-production source set only; no runtime coordinator behavior or security-sensitive paths change.

Overview
Introduces a reusable linea.config-docs convention plugin in buildSrc so apps can adopt config-documentation checks and generation without putting tooling on the production classpath.

The plugin adds a configDocs source set (compiled against main plus :jvm-libs:linea:config-docs), requires a configDocs { spec = "…" } FQCN, and registers checkConfigDocs / generateConfigDocs as forked JavaExec tasks that invoke the engine’s generic mains with that spec class name.

coordinator:app applies the plugin and adds CoordinatorConfigDocsSpec in the configDocs source set, declaring the five TOML config roots, section package prefix, and committed JSON/Markdown output paths under docs/tech/components/.

Reviewed by Cursor Bugbot for commit a89318d. Bugbot is set up for automated code reviews on this repo. Configure here.

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

…tive spec

Add a reusable 'linea.config-docs' buildSrc convention plugin that creates a
'configDocs' source set (compiled against main + the config-docs engine, kept
out of the production jar) and registers checkConfigDocs / generateConfigDocs
tasks. The tasks run the engine's generic entry points against the app's
ConfigDocsSpec, whose fully-qualified name is declared in build.gradle
(configDocs { spec = ... }) - no per-app entry-point code and no
META-INF/services file.

Coordinator applies the plugin and provides CoordinatorConfigDocsSpec (roots,
section detector, output paths) in the configDocs source set. checkConfigDocs
currently reports the undocumented keys; the config classes are annotated in
the next PR. Generated artifacts are committed in a later PR.

Refs: #3567
Signed-off-by: Gaurav Ahuja <gauravahuja9@gmail.com>
@gauravahuja
gauravahuja force-pushed the feat/config-docs-coordinator-wiring branch from 7fc9f75 to a89318d Compare July 23, 2026 09:51
@gauravahuja gauravahuja self-assigned this Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant